package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.Role;
import com.atguigu.jxc.entity.Supplier;
import org.apache.ibatis.annotations.Param;
import java.util.List;


/**
 * ClassName: SupplierMapper
 * Package: com.atguigu.jxc.dao
 *
 * @Description:
 * @Author: xvyy
 * @Create: 2025/2/21 - 10:49
 * @Version: v1.0
 */
public interface SupplierDao {

    /**
     * 根据供应商名称模糊查询供应商列表的数量
     * @param supplierName
     * @return
     */
    int getSupplierCount(@Param("supplierName") String supplierName);

    /**
     * 根据供应商名称模糊分页供应商列表
     * @param offSet
     * @param rows
     * @param supplierName
     * @return
     */
    List<Supplier> getSupplierList(@Param("offSet") int offSet, @Param("rows") Integer rows, @Param("supplierName") String supplierName);

    /**
     * 根据供应商名称查询供应商
     * @param supplierName
     * @return
     */
    Supplier findSupplierByName(@Param("supplierName") String supplierName);

    /**
     * 新增供应商
     * @param supplier
     */
    void insertSupplier(@Param("supplier") Supplier supplier);

    /**
     * 更新供应商
     * @param supplier
     */
    void updateSupplier(@Param("supplier") Supplier supplier , @Param("supplierId") Integer supplierId);

    /**
     * 根据供应商id查询供应商
     * @param supplierId
     * @return
     */
    Supplier getSupplierById(@Param("supplierId") int supplierId);

    /**
     * 删除供应商
     * @param supplierId
     */
    void deleteSupplier(@Param("supplierId") int supplierId);
}
